<template>
  <div>
    <div class="radios-box">
      <el-radio-group v-model="tabIndex" @change="jumpInfo">
        <el-radio-button :label="1" name="1">车辆维修登记总表</el-radio-button>
      </el-radio-group>
    </div>
    <div style="padding:10px 50px 30px">
      <el-row>
        <el-col :span="24">
          <div style="margin: 20px 0 30px">
            <el-button :disabled="!$store.getters.pageAuth.authoritySearch" size="mini" @click="search">搜索</el-button>
            <el-button :disabled="!$store.getters.pageAuth.authorityAdd" size="mini" @click="add">增加</el-button>
            <el-button :disabled="!$store.getters.pageAuth.authoritySearch" size="mini" @click="refresh">重置</el-button>
          </div>
          <el-table
            :data="carSearchObj"
            :border="true"
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            class="customTableStyle"
            style="font-size:12px;">
            <el-table-column
              type="index"
              label="编号"
              min-width="80"/>
            <el-table-column
              label="维修时间"
              min-width="180">
              <template slot-scope="scope">
                <el-date-picker
                  size="mini"
                  clearable
                  v-model="scope.row.wxsj[0]"
                  value-format="yyyy-M-d"
                  type="date"
                  class="datePicker"
                  placeholder="开始日期">
                </el-date-picker>
                <el-date-picker
                  size="mini"
                  clearable
                  v-model="scope.row.wxsj[1]"
                  value-format="yyyy-M-d"
                  type="date"
                  class="datePicker"
                  placeholder="结束日期">
                </el-date-picker>
              </template>
            </el-table-column>
            <el-table-column
              label="车牌号"
              min-width="120">
              <template slot-scope="scope">
                <el-select size="mini" filterable allow-create clearable v-model="scope.row.cph" placeholder="请选择">
                  <el-option
                    v-for="item in cpList"
                    :key="item.zxcph"
                    :label="item.zxcph"
                    :value="item.zxcph">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>      
            <el-table-column
              label="修理厂/店"
              min-width="110">
              <template slot-scope="scope">
                <el-select size="mini" clearable v-model="scope.row.xlcd" placeholder="请选择">
                  <el-option
                    v-for="item in repairFactoryList"
                    :key="item.id"
                    :label="item.wxcmc"
                    :value="item.wxcmc">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              label="维修类别(修/换/养/审)"
              min-width="140">
              <template slot-scope="scope">
                <el-select size="mini" clearable v-model="scope.row.wxlb" placeholder="请选择">
                  <el-option
                    v-for="item in repairClassList"
                    :key="item.id"
                    :label="item.wxlb"
                    :value="item.wxlb">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              label="维修项目"
              min-width="110">
              <template slot-scope="scope">
                <el-select size="mini" clearable v-model="scope.row.wxdx" placeholder="请选择">
                  <el-option
                    v-for="item in repairDxList"
                    :key="item.id"
                    :label="item.wxbyxm"
                    :value="item.wxbyxm">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              label="维修子项"
              min-width="110">
              <template slot-scope="scope">
                <el-select size="mini" clearable v-model="scope.row.wxzx" placeholder="请选择">
                  <el-option
                    v-for="item in repairXxList"
                    :key="item.id"
                    :label="item.wxbyxm"
                    :value="item.wxbyxm">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              label="规格"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" v-model="scope.row.gg" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="旧编号"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" v-model="scope.row.jbh" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="旧胎去向"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" v-model="scope.row.jtqx" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="新编号"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" v-model="scope.row.xbh" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="上线费"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" type="number" v-model="scope.row.sxf" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="综检费"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" type="number" v-model="scope.row.zjf" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="上牌费"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" type="number" v-model="scope.row.spf" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="工时费"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" type="number" v-model="scope.row.gsf" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="其他费"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" type="number" v-model="scope.row.qtf" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="数量"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" type="number" v-model="scope.row.sl" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="单价(元)"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" type="number" v-model="scope.row.dj" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="金额"
              min-width="80">
              <template slot-scope="scope">
                <el-input size="mini" type="number" v-model="scope.row.je" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="是否入账"
              min-width="80">
              <template slot-scope="scope">
                <el-select size="mini" clearable v-model="scope.row.sfrz" placeholder="请选择">
                  <el-option
                    label="是"
                    :value="true">
                  </el-option>
                  <el-option
                    label="否"
                    :value="false">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              label="负责司机"
              min-width="100">
              <template slot-scope="scope">
                <el-select size="mini" clearable v-model="scope.row.fzsj" placeholder="请选择">
                  <el-option
                    v-for="item in sjList"
                    :key="item.xm"
                    :label="item.xm"
                    :value="item.xm">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column
              label="备注"
              min-width="100">
              <template slot-scope="scope">
                <el-input size="mini" v-model="scope.row.bz" placeholder="请输入内容"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              label="操作"
              min-width="150">
              <template slot-scope="scope">
              </template>
            </el-table-column>
          </el-table>
          <el-pagination
            :total="page.totalCount"
            :page-size="page.pageSize"
            :current-page.sync="page.currPage"
            style="margin-top: 10px;"
            background
            layout="total, slot, prev, pager, next"
            @current-change="search">
            <span>—&nbsp;&nbsp;&nbsp;共 {{page.totalPage}} 页</span>
          </el-pagination>
          <div v-if="addVisi" style="margin-top: 20px">
            <el-row>
              <el-col :span="24">
                <el-card class="box-card">
                  <div slot="header" class="clearfix">
                    <span>增加</span>
                    <el-button style="float: right; font-size:12px; padding: 7px 15px;margin-left:10px" type="text" @click="addClick">保存</el-button>
                    <el-button style="float: right; font-size:12px; padding: 7px 15px;" type="text" @click="addVisi = false">取消</el-button>
                  </div>
                  <div>
                    <el-table
                      :data="addCar"
                      :border="true"
                      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
                      class="customTableStyle"
                      style="font-size:12px;">
                      <el-table-column
                        label="车牌号"
                        min-width="120">
                        <template slot-scope="scope">
                          <el-select size="mini" filterable clearable v-model="scope.row.cph" placeholder="请选择">
                            <el-option
                              v-for="item in cpList"
                              :key="item.zxcph"
                              :label="item.zxcph"
                              :value="item.zxcph">
                            </el-option>
                          </el-select>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="维修时间"
                        min-width="150">
                        <template slot-scope="scope">
                          <el-date-picker
                            v-model="scope.row.wxsj"
                            value-format="yyyy-M-d"
                            type="date"
                            size="mini"
                            class="datePicker"
                            placeholder="选择日期">
                          </el-date-picker>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="修理厂/店"
                        min-width="100">
                        <template slot-scope="scope">
                          <el-select size="mini" clearable v-model="scope.row.xlcd" placeholder="请选择">
                            <el-option
                              v-for="item in repairFactoryList"
                              :key="item.id"
                              :label="item.wxcmc"
                              :value="item.wxcmc">
                            </el-option>
                          </el-select>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="维修类别"
                        min-width="100">
                        <template slot-scope="scope">
                          <el-select size="mini" clearable v-model="scope.row.wxlb" placeholder="请选择">
                            <el-option
                              v-for="item in repairClassList"
                              :key="item.id"
                              :label="item.wxlb"
                              :value="item.wxlb">
                            </el-option>
                          </el-select>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="维修大项"
                        min-width="100">
                        <template slot-scope="scope">
                          <el-select size="mini" clearable v-model="scope.row.wxdx" placeholder="请选择">
                            <el-option
                              v-for="item in repairDxList"
                              :key="item.id"
                              :label="item.wxbyxm"
                              :value="item.wxbyxm">
                            </el-option>
                          </el-select>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="维修子项"
                        min-width="100">
                        <template slot-scope="scope">
                          <el-select size="mini" clearable v-model="scope.row.wxzx" placeholder="请选择">
                            <el-option
                              v-for="item in repairXxList"
                              :key="item.id"
                              :label="item.wxbyxm"
                              :value="item.wxbyxm">
                            </el-option>
                          </el-select>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="规格"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input size="mini" v-model="scope.row.gg" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="旧编号"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input size="mini" v-model="scope.row.jbh" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="旧胎去向"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input size="mini" v-model="scope.row.jtqx" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="新编号"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input size="mini" v-model="scope.row.xbh" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="上线费"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input @input="addComputed" size="mini" type="number" v-model="scope.row.sxf" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="综检费"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input @input="addComputed" size="mini" type="number" v-model="scope.row.zjf" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="上牌费"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input @input="addComputed" size="mini" type="number" v-model="scope.row.spf" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="工时费"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input @input="addComputed" size="mini" type="number" v-model="scope.row.gsf" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="其他费"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input @input="addComputed" size="mini" type="number" v-model="scope.row.qtf" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="数量"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input @input="addComputed" size="mini" type="number" v-model="scope.row.sl" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="单价(元)"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-input @input="addComputed" size="mini" type="number" v-model="scope.row.dj" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="金额"
                        min-width="80">
                        <template slot-scope="scope">
                          {{ scope.row.je }}
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="是否入账"
                        min-width="80">
                        <template slot-scope="scope">
                          <el-select size="mini" clearable v-model="scope.row.sfrz" placeholder="请选择">
                            <el-option
                              label="是"
                              :value="true">
                            </el-option>
                            <el-option
                              label="否"
                              :value="false">
                            </el-option>
                          </el-select>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="负责司机"
                        min-width="100">
                        <template slot-scope="scope">
                          <el-select size="mini" clearable v-model="scope.row.fzsj" placeholder="请选择">
                            <el-option
                              v-for="item in sjList"
                              :key="item.xm"
                              :label="item.xm"
                              :value="item.xm">
                            </el-option>
                          </el-select>
                        </template>
                      </el-table-column>
                      <el-table-column
                        label="备注"
                        min-width="100">
                        <template slot-scope="scope">
                          <el-input size="mini" v-model="scope.row.bz" placeholder="请输入内容"></el-input>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>
                </el-card>
              </el-col>
            </el-row>
          </div>
          <el-table
            :data="page.list"
            :border="true"
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            highlight-current-row
            @row-click="rowClick"
            class="customTableStyle"
            style="font-size:12px;">
            <el-table-column
              type="index"
              label="编号"
              min-width="80"/>
            <el-table-column
              label="维修时间"
              min-width="180">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-date-picker
                    v-model="editCar.wxsj"
                    value-format="yyyy-M-d"
                    type="date"
                    size="mini"
                    class="datePicker"
                    placeholder="选择日期">
                  </el-date-picker>
                </div>
                <div v-else>{{ scope.row.wxsj }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="车牌号"
              min-width="120">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-select size="mini" filterable clearable v-model="editCar.cph" placeholder="请选择">
                    <el-option
                      v-for="item in cpList"
                      :key="item.zxcph"
                      :label="item.zxcph"
                      :value="item.zxcph">
                    </el-option>
                  </el-select>
                </div>
                <div v-else>{{ scope.row.cph }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="修理厂/店"
              min-width="110">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-select size="mini" clearable v-model="editCar.xlcd" placeholder="请选择">
                    <el-option
                      v-for="item in repairFactoryList"
                      :key="item.id"
                      :label="item.wxcmc"
                      :value="item.wxcmc">
                    </el-option>
                  </el-select>
                </div>
                <div v-else>{{ scope.row.xlcd }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="维修类别(修/换/养/审)"
              min-width="140">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-select size="mini" clearable v-model="editCar.xlcd" placeholder="请选择">
                    <el-option
                      v-for="item in repairClassList"
                      :key="item.id"
                      :label="item.wxlb"
                      :value="item.wxlb">
                    </el-option>
                  </el-select>
                </div>
                <div v-else>{{ scope.row.wxlb }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="维修项目"
              min-width="110">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-select size="mini" clearable v-model="editCar.wxdx" placeholder="请选择">
                    <el-option
                      v-for="item in repairDxList"
                      :key="item.id"
                      :label="item.wxbyxm"
                      :value="item.wxbyxm">
                    </el-option>
                  </el-select>
                </div>
                <div v-else>{{ scope.row.wxdx }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="维修子项"
              min-width="110">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-select size="mini" clearable v-model="editCar.wxzx" placeholder="请选择">
                    <el-option
                      v-for="item in repairXxList"
                      :key="item.id"
                      :label="item.wxbyxm"
                      :value="item.wxbyxm">
                    </el-option>
                  </el-select>
                </div>
                <div v-else>{{ scope.row.wxzx }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="规格"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input size="mini" v-model="editCar.gg" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.gg }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="旧编号"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input size="mini" v-model="editCar.jbh" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.jbh }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="旧胎去向"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input size="mini" v-model="editCar.jtqx" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.jtqx }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="新编号"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input size="mini" v-model="editCar.xbh" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.xbh }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="上线费"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input @input="editComputed" size="mini" type="number" v-model="editCar.sxf" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.sxf }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="综检费"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input @input="editComputed" size="mini" type="number" v-model="editCar.zjf" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.zjf }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="上牌费"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input @input="editComputed" size="mini" type="number" v-model="editCar.spf" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.spf }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="工时费"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input @input="editComputed" size="mini" type="number" v-model="editCar.gsf" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.gsf }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="其他费"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input @input="editComputed" size="mini" type="number" v-model="editCar.qtf" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.qtf }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="数量"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input @input="editComputed" size="mini" type="number" v-model="editCar.sl" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.sl }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="单价(元)"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input @input="editComputed" size="mini" type="number" v-model="editCar.dj" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.dj }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="金额"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  {{ editCar.je }}
                </div>
                <div v-else>{{ scope.row.je }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="是否入账"
              min-width="80">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-select size="mini" clearable v-model="scope.row.sfrz" placeholder="请选择">
                    <el-option
                      label="是"
                      :value="true">
                    </el-option>
                    <el-option
                      label="否"
                      :value="false">
                    </el-option>
                  </el-select>
                </div>
                <div v-else>{{ scope.row.sfrz }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="负责司机"
              min-width="100">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-select size="mini" clearable v-model="editCar.fzsj" placeholder="请选择">
                    <el-option
                      v-for="item in sjList"
                      :key="item.xm"
                      :label="item.xm"
                      :value="item.xm">
                    </el-option>
                  </el-select>
                </div>
                <div v-else>{{ scope.row.fzsj }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="备注"
              min-width="100">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-input size="mini" v-model="editCar.bz" placeholder="请输入内容"></el-input>
                </div>
                <div v-else>{{ scope.row.bz }}</div>
              </template>
            </el-table-column>
            <el-table-column
              label="操作"
              min-width="150">
              <template slot-scope="scope">
                <div v-if="editVisi && scope.row.id == editCar.id">
                  <el-button size="mini" @click="editClick">保存</el-button>
                  <el-button size="mini" @click="editVisi = false">取消</el-button>
                </div>
                <div v-else>
                  <el-button :disabled="!$store.getters.pageAuth.authorityUpdate" size="mini" @click="edit(scope.row)">修改</el-button>
                  <el-button :disabled="!$store.getters.pageAuth.authorityDelete" size="mini" @click="deleteClick(scope.row.id)">删除</el-button>
                </div>
                
              </template>
            </el-table-column>
          </el-table>
          <el-table
            :data="[{}]"
            :border="true"
            :show-header="true"
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            class="customTableStyle sumTable"
            style="font-size:12px;">
            <el-table-column
              label=""
              min-width="50">
              <template slot-scope="scope">
                汇总
              </template>
            </el-table-column>
            <el-table-column
              label="维修时间"
              min-width="180">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="车牌号"
              min-width="120">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="修理厂/店"
              min-width="110">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="维修类别(修/换/养/审)"
              min-width="140">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="维修项目"
              min-width="110">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="维修子项"
              min-width="110">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="规格"
              min-width="80">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="旧编号"
              min-width="80">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="旧胎去向"
              min-width="80">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="新编号"
              min-width="80">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="上线费"
              class-name="text"
              min-width="80">
              <template slot-scope="scope">
                {{ pageTotal.sxfTotal }}
              </template>
            </el-table-column>
            <el-table-column
              label="综检费"
              class-name="text"
              min-width="80">
              <template slot-scope="scope">
                {{ pageTotal.zjfTotal }}
              </template>
            </el-table-column>
            <el-table-column
              label="上牌费"
              class-name="text"
              min-width="80">
              <template slot-scope="scope">
                {{ pageTotal.spfTotal }}
              </template>
            </el-table-column>
            <el-table-column
              label="工时费"
              class-name="text"
              min-width="80">
              <template slot-scope="scope">
                {{ pageTotal.gsfTotal }}
              </template>
            </el-table-column>
            <el-table-column
              label="其他费"
              class-name="text"
              min-width="80">
              <template slot-scope="scope">
                {{ pageTotal.qtfTotal }}
              </template>
            </el-table-column>
            <el-table-column
              label="数量"
              class-name="text"
              min-width="80">
              <template slot-scope="scope">
                {{ pageTotal.slTotal }}
              </template>
            </el-table-column>
            <el-table-column
              label="单价(元)"
              min-width="80">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="金额"
              class-name="text"
              min-width="80">
              <template slot-scope="scope">
                {{ pageTotal.jeTotal }}
              </template>
            </el-table-column>
            <el-table-column
              label="是否入账"
              min-width="80">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="负责司机"
              min-width="100">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="备注"
              min-width="100">
              <template slot-scope="scope">
              </template>
            </el-table-column>
            <el-table-column
              label="操作"
              min-width="150">
              <template slot-scope="scope">
              </template>
            </el-table-column>
          </el-table>
          
        </el-col>
      </el-row>
      <div v-if="activeCar.id">
        <el-row>
          <el-col :span="24">
            <el-row>
              <div class="upload-scrollcontainer">
                <div class="upload-scrollbox" :style="{width: (activeImgList.length+1) * 160 + 'px'}">
                  <div class="upload-container">
                    <imgUpload :id="activeCar.id" type="carMaintenance" @success="getImgList"/>
                  </div>
                  <div v-for="(item, index) in activeImgList" :key="item.path" class="upload-container">
                    <div class="upload-title">{{index +1}}&nbsp;&nbsp;{{ item.bz }}</div>
                    <div class="upload-pic-box">
                      <img :src="item.path" alt="" @click="$imageViewer">
                    </div>
                    <i class="el-icon-delete upload-del" @click.stop="imgDel(item.name)"></i>
                  </div>
                </div>
              </div>
            </el-row>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-row>
              <div>
                <!-- <el-button size="mini" @click="printPic">图片打印</el-button> -->
              </div>
            </el-row>
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
import adapter from './adapter'
import imgUpload from '@/components/imgUpload'
export default {
  name: 'carMaintenance',
  filters: {
  },
  components: {
    imgUpload,
  },
  data() {
    return {
      ...adapter.data,
      tabIndex: 1, // tab序号
    }
  },
  computed: {
    ...adapter.computed
  },
  created() {
    // 初始化
    this.initPage()
    Promise.all([this.getListRepairFactory(), this.getListRepairClass(), this.getListRepairDx(), this.getListRepairXx(), this.getListCp(), this.getListSj()]).then (() => {
      })
    this.search()
  },
  mounted() {
  },
  methods: {
    ...adapter.methods,
    /**
     * 跳转车辆/员工信息
     */
    jumpInfo(tabIndex) {
    },
    // 打印图片
    async printPic(code) {
      const printHtml = document.getElementById('printDiv').innerHTML
      const wind = window.open('', 'newwindow', 'height=600, width=1000, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')
      // wind.document.title = '结算单'
      wind.document.body.innerHTML = printHtml
      wind.print()
      return false
    },
  }
}
</script>
<style>
</style>
<style lang="scss" scoped>

.el-input-number{
  width: 90px;
}
.car-detail-title{
  font-size: 30px;
  text-align: center;
}
.radios-box{
  padding: 20px 0 10px 20px;
}
</style>

